package com.itcast.jfinal.controller;

import com.itcast.jfinal.dao.User;
import com.itcast.jfinal.service.DynamicService;
import com.jfinal.aop.Inject;
import com.jfinal.core.Controller;
import com.jfinal.core.Path;

/**
 * 参数获取controller
 *
 * @author zheng.zhang
 */
@Path("/dynamic")
public class DynamicController extends Controller {
    @Inject
    private DynamicService dynamicService;

    public void index(User user) {
        boolean flag = dynamicService.savePerson(user);
        if (!flag) {
            renderError(500);
        }
        renderJson(user);
    }
}
